---------------------------------------------------
Copyright (c) 2008 University of South Florida

LoPSiL - A Location-based Policy Specification Language
by Jay Ligatti, Billy Rickey, and Nalin Saigal.

Implementation by: Billy Rickey, Nalin Saigal, and Jay Ligatti

** Introduction **
LoPSiL is a location-based policy specification language that helps
users specify policies that are location dependent. LoPSiL has been 
implemented and tested on Java version 1.6.0. You can contact us to 
report for bugs or improvements to LoPSiL at the following email
addresses:
ligatti@cse.usf.edu, nsaigal@cse.usf.edu


** Installation Instructions **
In order to compile your policies, you must first download and install
AspectJ 5.  This can be obtained from http://www.eclipse.org/aspectj.
Throughout these instructions, we refer to the AspectJ installation
directory as <%AspectJ%>

The GPS device used in the example policies was a Garmin GPS and it 
communicated with the computer via the Java Communication API.
Instructions for allowing the identification for communication ports 
can be found here:
http://dn.codegear.com/article/31915.

Once you have AspectJ installed, follow these steps to weave the 
security policy into your application:

1. Add <%AspectJ%>\lib\aspectjrt.jar to your classpath, and
   <%AspectJ%>\bin to your path.

2. Double-click on "Lopsil2aj.jar" to run the LoPSiL Converter.

3. Translate your .lopsil and .srm files to compatible LoPSiL files
   by specifying the locations of each file when prompted to.

4. Place the converted files into a folder in the same directory as 
   the jar file that you wish to monitor.

4. Go to the directory in which your jar application is present, and
   using the following command syntax, compile your application with 
   the converted policy files and all external libraries referenced 
   by the application:

	ajc -inpath <application.jar> -sourceroots <security file folder>
      -inpath lopsil.jar -inpath aspectjrt.jar -inpath <external lib> 
      -inpath <external lib> ... -outjar <output.jar>
		
<application.jar> is the original name of the application that you wish
to monitor.
<security file folder> is the name of the folder that has the .java and
.aj files generated by the Lopsil2aj converter.
<external lib> are the external .jar file libraries that the original 
application relies on.
<output.jar> is the name of the application with the policy code injected.

5. Your application is now ready to run.  You can run the application by
   typing <output.jar> in the command line or by double-clicking on the 
   jar file.